//
//  PitureCell.swift
//  swiftTS
//
//  Created by 航电 on 2020/2/28.
//  Copyright © 2020 航电. All rights reserved.
//

import UIKit

class PitureCell: UITableViewCell {

    var imgView = UIImageView();
    let screenSize = UIScreen.main.bounds.size;
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

    public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier);
        
        self.onCreateUIForView();
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func onCreateUIForView() {
        self.imgView = UIImageView(frame: CGRect(x: 0, y: 0, width: screenSize.width, height: 320));
        self.imgView.backgroundColor = UIColor.lightGray;
        self.imgView.contentMode = .scaleToFill;
        self.contentView.addSubview(self.imgView);
    }
    
    override func layoutSubviews() {
        self.imgView.image = UIImage(named: "picture_01");
    }
}
